<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="./template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<ui:define name="titulo">
	    <h:outputText  value="Cadastro de alunos"/>
	</ui:define>	
	
	<ui:define name="body">
	    <rich:panel id="panelBar" heigth="400" width="600">
	        <f:facet name="header">Cadastro de alunos</f:facet>
	        <h:form>
	            <h:panelGrid columns="2">
	                <h:outputText value="Nome: " />
	                <h:inputText value="#{alunoController.aluno.nome}" />
	            </h:panelGrid>
	            <h:panelGrid columns="2">
	                <h:outputText value="E-mail: " />
	                <h:inputText value="#{alunoController.aluno.email}" />	             
	            </h:panelGrid>
	            <h:panelGrid columns="2">
	                <h:outputText value="Turma: " />	  
	                <!--               
                    <rich:comboBox selectFirstOnUpdate="false" defaultLabel="Selecione uma turma">

                    </rich:comboBox>    
                    
                    <rich:comboBox selectFirstOnUpdate="false" defaultLabel="Enter some value">
                        <f:selectItems value="#{capitalsBean.capitalsOptions}" />
                    </rich:comboBox>
                    -->
	            </h:panelGrid>
	            <h:commandButton value="Cadastrar" action="#{alunoController.salvar}" />
	            <h:commandLink value="Voltar" action="INDEX" />
	        </h:form>
	        
	        <rich:dataTable var="aluno" value="#{alunoController.listaAlunos}">
	            <f:facet name="header">
	                <rich:columnGroup>
	                    <rich:column>
	                        <h:outputText value="Nome" />
	                    </rich:column>
	                    <rich:column>
	                        <h:outputText value="E-mail" />
	                    </rich:column>
	                </rich:columnGroup>
	            </f:facet>
	            <rich:column>
	                <h:outputText value="#{aluno.nome}" />
	            </rich:column>
	            <rich:column>
	                <h:outputText value="#{aluno.email}" />
	            </rich:column>
	        </rich:dataTable>
	    </rich:panel>
	</ui:define>	
</ui:composition>